package com.xuecheng.content.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.content.domain.TeachplanWork;
import com.xuecheng.content.mappers.TeachplanWorkMapper;
import com.xuecheng.content.service.TeachplanWorkService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author itheima
 * @since 2022-09-17
 */
@Service
public class TeachplanWorkServiceImpl extends ServiceImpl<TeachplanWorkMapper, TeachplanWork> implements TeachplanWorkService {
    //作业解绑
    @Override
    public ResponseResult<Boolean> jiebang(Long teachplanWorkId, PageRequest request) {
        LambdaQueryWrapper<TeachplanWork> twQw = new LambdaQueryWrapper<>();
        twQw.eq(TeachplanWork::getId, teachplanWorkId);
        TeachplanWork teachplanWork = this.getOne(twQw);
        boolean b = this.removeById(teachplanWork.getId());
        return ResponseResult.okResult();
    }
}
